<!--资费情况-->
<template>
	<div class="tariff-information">
		<DicTable height="100%" stripe highlight-current-row highlight-hover-row max-height="600" ref="GBLtable" border
			header-row-class-name="header-row-class" row-class-name="ne-row-class" :columnData="GBLtbs.tableColumns"
			:tableData="GBLtbs.tableData" :loading="GBLtbs.tableLoading" :currentPage="~~GBLtbs.tablePage.pageIndex"
			:pageSize="~~GBLtbs.tablePage.pageSize" :totalResult="~~GBLtbs.tablePage.rowCount" :pager="true"
			@on-page-change="handlePageChange">
		</DicTable>
	</div>
</template>
<script>
	import DicTable from "@/components/public/DicTable";
	import CustOrderService from "@/api/order/CustOrderService";
	import {
		mapState
	} from "vuex";
	export default {
		name: "TariffInformation",
		data() {
			return {
				GBLtbs: {
					tableColumns: [{
							field: "custSoNumber",
							title: "流水号",
							width: '8%'
						},
						{
							field: "prodName",
							title: "产品名称"
						},
						{
							field: "areaName",
							title: "装机地址"
						},
						{
							field: "disAreaName",
							title: "通达地址"
						},
						{
							field: "orgName",
							title: "端局",
							width: '10%'
						},
						{
							field: "resultInfo",
							title: "核实资费情况",
							width: '8%'
						},
						{
							field: "taskReqDate",
							title: "核实资费要求反馈日期",
							width: '10%'
						},
						{
							field: "taskOprDate",
							title: "核实资费反馈日期",
							width: '8%'
						},
						{
							field: "userName",
							title: "核实资费反馈人"
						},
						{
							field: "linkTel",
							title: "核实资费人联系电话",
							width: '10%'
						},
						{
							field: "taskComment",
							title: "说明"
						}
					],
					tableData: [],
					tableLoading: false,
					tablePage: {
						pageIndex: 1,
						pageSize: 10,
						rowCount: 0,
					},
				}
			}
		},
		props: {
			// ODKInfo: {
			//   type: Object
			// },
			CTOInfo: {
				type: Object
			}
		},
		mounted() {

		},
		created() {
			this.getList();
		},
		components: {
			DicTable
		},
		computed: {
			...mapState("user", ["user"]),
		},
		methods: {
			async getList() {
				let {
					custOrderId,
					custSoNumber,
					custId,
					handleOrgId
				} = this.CTOInfo,
					pageInfo = {
						pageIndex: ~~this.GBLtbs.tablePage.pageIndex + '',
						pageSize: ~~this.GBLtbs.tablePage.pageSize + ''
					},
					params = {
						custOrderId,
						custSoNumber,
						custId,
						handleOrgId,
						orgId: this.user.orgId,
						pageInfo: pageInfo
					};
				const result = await CustOrderService.qryTariffVerification(params);
				if (result.meta.resultCode == '0' || !result.meta.resultCode) {
					this.GBLtbs.tableData = result.meta.orderTariffVerifications;
					this.GBLtbs.tablePage = {
						pageIndex: ~~Number(result.meta.pageInfo.pageIndex),
						pageSize: ~~Number(result.meta.pageInfo.pageSize),
						rowCount: ~~Number(result.meta.pageInfo.rowCount)
					};
				} else {
					this.$message({
						showClose: true,
						message: result.meta.resultMsg,
						type: 'error'
					});
				};
			},

			handlePageChange({
				currentPage,
				pageSize
			}) {
				this.GBLtbs.tablePage.pageIndex = currentPage;
				this.GBLtbs.tablePage.pageSize = pageSize;
				this.getList();
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>
